#ifndef __ATOMTRACE_HITRECORD_H_
#define __ATOMTRACE_HITRECORD_H_

#include "Vector3.h"
#include "atUtil.h"

namespace AtomTrace{

    typedef struct HitRecord
    {
        float t; // the closest hit
        int objID;
        int matID; // material ID
        Vector3 P; // hit point
        Vector3 N; // hit normal

        Vector3 e1;
        Vector3 e2; // triangle edge

        inline void Init()
        {
            t = 10000000.0f;
            objID = -1;
            matID = -1;
            P.Set(0.0f, 0.0f, 0.0f);
            N.Set(0.0f, 1.0f, 0.0f);
        }

        inline const Vector3 GetTriangleNormal() const
        {
            return GetCrossNormal(e1, e2);
        }
    }HitRecord;

} // namespace AtomTrace

#endif //__ATOMTRACE_HITRECORD_H_
